<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGroupMemberTable extends Migration
{
    /**
     * Run the migrations.
     *  业务组成员
     * @return void
     */
    public function up()
    {
        Schema::create('group_member', function (Blueprint $table) {
	        $table->increments('id');
	        $table->integer('group_id')->comment('业务组id');
	        $table->integer('user_id')->comment('成员id');
	        $table->integer('department_id')->comment('所属部门id')->nullable();
	        $table->string('department_name')->comment('所属部门名称');
	        $table->string('realname')->comment('真实姓名');
	        $table->string('role_name')->comment('角色名称');
	        $table->string('address')->comment('用户地址');

	        $table->integer('company_id')->comment('所属公司id')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('group_member');
    }
}
